package com.cskaoyan.bean.vo.vxVo;

import com.cskaoyan.bean.po.wxPo.MarketAddress;
import lombok.Data;

import java.util.Date;

/**
 * @author: DYQ
 * @time: Created on 2022/6/7 11:37
 */

@Data
public class AddressListVo {

    private int id;

    private String name;

    private int userId;

    private String province;

    private String city;

    private String county;

    private String addressDetail;

    private String areaCode;

    private String tel;

    private boolean isDefault;

    private Date addTime;

    private Date updateTime;

    private boolean deleted;

    public static AddressListVo data(MarketAddress marketAddress){
        AddressListVo addressListVo = new AddressListVo();
        addressListVo.setId(marketAddress.getId());
        addressListVo.setName(marketAddress.getName());
        addressListVo.setUserId(marketAddress.getUserId());
        addressListVo.setProvince(marketAddress.getProvince());
        addressListVo.setCity(marketAddress.getCity());
        addressListVo.setCounty(marketAddress.getCounty());
        addressListVo.setAddressDetail(marketAddress.getAddressDetail());
        addressListVo.setAreaCode(marketAddress.getAreaCode());
        addressListVo.setTel(marketAddress.getTel());
        addressListVo.setDefault(marketAddress.getIsDefault());
        addressListVo.setAddTime(marketAddress.getAddTime());
        addressListVo.setUpdateTime(marketAddress.getUpdateTime());
        addressListVo.setDeleted(marketAddress.getDeleted());
        return addressListVo;
    }

}
